<div class="pageContent">
    <form method="post"
        action="${rc.getContextPath()}/manage/maintainConfig/saveMaintainConfig"
        class="pageForm required-validate"
        onsubmit="return validateCallback(this, subDone);">
        <div class="pageFormContent">
            <input type="hidden" name="navTabId" value="${navTabId!''}">
            <input type="hidden" name="id"
                value="<#if (config.equipmentCode)??>${config.equipmentCode!''}</#if>">
                <input type="hidden" id="fileJson">
            <fieldset class="dataset">
                <dl>
                    <dt><@label key="equipmentCode.C,colon">设备编号：</@label></dt>
                    <dd>
                      <input readonly value="<#if (config.equipmentCode)??>${config.equipmentCode!''}</#if>" class="required" id="equipmentLookup.equipmentCode" name="equipmentCode" type="text"/>
                    
                    </dd>
                </dl>
                <dl>
                    <dt><@label key='equipmentText.C,colon'>设备描述：</@label></dt>
                <dd><input value="<#if (config.equipmentText)??>${config.equipmentText!''}</#if>" id="equipmentLookup.equipmentText" readonly size="22" type="text" maxlength="60" name="equipmentText" />
            </dd>
                </dl>
                <dl>
                    <dt><@label key="strategyCode.C,colon">维护策略编号：</@label></dt>
                    <dd>
                      <input readonly class="required" id="strategyLookup.strategyCode" name="strategyCode" type="text" value="<#if (config.strategyCode)??>${config.strategyCode!''}</#if>" />
                    </dd>
                </dl>
                    <dl>
                    <dt><@label key="strategyText.C,colon">维护策略描述：</@label></dt>
                    <dd>
                        <input readonly id="strategyLookup.strategyText" name="strategyText"
                            size="32" type="text" value="<#if (config.strategyText)??>${config.strategyText!''}</#if>"/>
                    </dd>
                </dl>
                    <dl>
                    <dt><@label key="prevMaintainDate.C,colon">上次维护日期：</@label></dt>
                    <dd>
                        <input type="text" class="required"  readonly="readonly" name="prevMaintainDate" dateFmt="yyyy-MM-dd" value="<#if (config.prevMaintainDate)??>${config.prevMaintainDate?string("yyyy-MM-dd")}</#if>"/> 
                    </dd>
                </dl>
                                <dl>
                    <dt><@label key="nextMaintainDate.C,colon">下次维护日期：</@label></dt>
                    <dd>
                        <input type="text" readonly="readonly" name="nextMaintainDate" dateFmt="yyyy-MM-dd" value="<#if (config.nextMaintainDate)??>${config.nextMaintainDate?string("yyyy-MM-dd")}</#if>"/> 
                    </dd>
                </dl>
                                <dl>
                    <dt><@label key="currCountValue.C,colon">当前损耗点：</@label></dt>
                    <dd>
                        <input readonly type="text" class="required digits" name="currCountValue"   maxlength="10" value="<#if (config.currCountValue)??>${config.currCountValue!''}</#if>"/>
                    </dd>
                </dl>
                    <dl>
                    <dt><@label key="totalCountValue.C,colon">累计损耗点：</@label></dt>
                    <dd>
                        <input readonly type="text" class="required digits" name="totalCountValue"  maxlength="10" value="<#if (config.zzzzzzzzzzztotalCountValue)??>${config.totalCountValue!''}</#if>"/>
                    </dd>
                </dl>
                <dl style="padding:0;height:120px;width:560px;border-color: #d8dfe5; border-style: solid;border-width: 1px;">
                <table class="table" layoutH="300" width="100%" id="processAttachMentTable">
                            <thead>
                                <tr>
                                    <th width="100px"><@label key='fileName.C'>文件名称</@label></th>
                                    <th width="100px"><@label key='fileSize.C'>文件大小(bytes)</@label></th>
                                    <th width="50px"><@label key="opera.C">操作</@label></th>
                                </tr>
                            </thead>
                            <tbody>
                                <#if files??><#if (files?size>0)> <#list files as file>
                                <tr id="${file.attachmentCode!''}" target="file_code" rel="${file.fileName!''}">
                                    <td width="100">${file.fileName!''}</td>
                                    <td width="100">${file.fileSize!''}</td>
                                    <td width="100">
                                    <a title="<@label key='download.B'>下载</@label>" target="dwzExport" class='btnAttach' href="${rc.getContextPath()}/manage/common/downloadAttachement?fileName=${file.fileName!''}&attachmentCode=${file.attachmentCode!''}"></a>
                                    </td>
                                </tr>
                                </#list> </#if> </#if>
                            </tbody>
                        </table>
                </dl>
            </fieldset>
        </div>
            <#assign createInfo=config/>
            <#include "/common/createInfo.html">
        <div class="formBar">
            <ul>
                    <li>
                    <div class="buttonActive"><div class="buttonContent">    <button type="button" class="close"><@label key="close.B">关闭</@label></button></div></div>
                </li>
            </ul>
        </div>
    </form>
</div>
<script type="text/javascript">
    function subDone(json)
    {
        if(json["statusCode"]==200)
            {
            if($("#fileQueue").text()!="")
                {
                var equipmentCode = $("#equipmentLookup\\.equipmentCode").val();
                var strategyCode = $("#strategyLookup\\.strategyCode").val();
                $("#fileJson").val(JSON.stringify(json));
                $('#fileupload').uploadify('settings','formData',{'equipmentCode': equipmentCode,'strategyCode':strategyCode});
                $('#fileupload').uploadify('upload', '*');
                }
            else
                {
                dialogAjaxDone(json);
                }
    
            }
        else
            {
            dialogAjaxDone(json);
            }
        
      
    }
    
    function onUploadSuccess()
    {
        dialogAjaxDone(jQuery.parseJSON($("#fileJson").val()));
    }
    
    function _delProcessAttachment(equipmentCode,strategyCode,attachmentCode) {
            $.DWZajax({
                url:hostUrl +"/maintainConfig/delConfigAttachment",
                data:{'equipmentCode':equipmentCode,'strategyCode':strategyCode,'attachmentCode':attachmentCode},
                callback:function(data){
                    var _id =equipmentCode;
                    $("tr#"+_id).remove();
                }
            });
        
    }
    </script>